import { Button, NavBar } from 'antd-mobile';
import React from 'react'
import { useNavigate } from 'react-router-dom';
const My = () => {
    const navigate = useNavigate()
    const yh = localStorage.getItem("userInfo")
    console.log(yh);

    const tc = () => {
        localStorage.removeItem("token")
        localStorage.removeItem("userInfo")
        navigate("/login")
    }
    return (
        <div>

            <NavBar onBack={() => navigate(-1)}>我的</NavBar>
            <div>
                姓名:{yh}
            </div>
            <Button block color='primary' onClick={() => tc()}>退出</Button>
        </div>
    )
}

export default My
